package com.fhz.hilttest

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import dagger.hilt.android.AndroidEntryPoint
import javax.inject.Inject

@AndroidEntryPoint
class MainActivity : AppCompatActivity() {

    @Inject
    @DaUser
    lateinit var user: User

    @Inject
    @XiaoUser
    lateinit var user1: User

    @Inject
    lateinit var analyticsAdapter: AnalyticsAdapter

    @Inject
    lateinit var myAdatper: MyAdapter

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        println(user.name) //new  hilt 依赖注入的方式,提供了user对象.
        println(user1.name) //new  hilt 依赖注入的方式,提供了user对象.
        analyticsAdapter.test()

//        myAdatper = MyAdapter(MyServerImpl())
        myAdatper.test()
    }
}